import time
import urllib.request
import config
class utils:

    def getLocationTime(timeformat='%Y-%m-%d %X'):
        return time.strftime( timeformat, time.localtime( time.time() ) )
    
    def getHtmlFromUrl(url):
        """"""
        downContent = ''
        try:
            response = urllib.request.urlopen(url)
            downContent = response.read()
            return downContent.decode(config.decode)
        except :
            print('down error:',url)
            return downContent
        